package cn.gson.springboot.controller;

import cn.gson.springboot.model.pojos.Timeline;
import cn.gson.springboot.model.service.TimelineService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
public class TimelineController {
    @Autowired
    TimelineService timelineService;

    @RequestMapping("/timeline-list")
    @ResponseBody
    public List<Timeline> selectTimelineByCustomerId(Integer customerId){
        List<Timeline> list = timelineService.selectTimelineByCustomerId(customerId);
        return list;
    }

    @RequestMapping("/timeline-type-list")
    @ResponseBody
    public List<Timeline> selectTimelineByActiveName(Integer customerId,String activeName){
        List<Timeline> list = timelineService.selectTimelineByActiveName(customerId,activeName);
        return list;
    }
}
